package com.vhall.component.entity.goods.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;

/**
 * GuoXinOftypeEnum-基金类型
 *
 * @author xing.wang
 * @date 2023/8/24
 */
public enum GuoXinOftypeEnum implements BaseEnum {
    TYPE_1("1", "股票型"), TYPE_2("2", "混合型"), TYPE_3("3", "债券型"), TYPE_4("4", "货币型"), TYPE_6("6", "QDII"), TYPE_7("7", "其他");

    private final String value;
    private final String name;

    GuoXinOftypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    /**
     * 通过 value 获取 name
     *
     * @param value
     * @return
     */
    public static String getNameByValue(String value) {
        for (GuoXinOftypeEnum e : GuoXinOftypeEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}